<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
    <div id='app'>
        {{msg}}

        <brother>
            
            <template v-slot:header="slotProps">
                <h1>{{slotProps.header + ' ' + msg}}</h1>
                
            </template>
            <template v-slot:default>
                <p>返回 <span>扫一扫</span> </p>
            </template>


            <template v-slot:footer>
                <p>底部</p>
            </template>
        </brother>

    </div>
    <script type='text/javascript'>

        var brother = {
            data() {
                return {
                    header: "这是一个son组件1111",
                    bb: "我是哥哥"
                }
            },
            mrthods: {},
            template: `<div>
                这是一个brother组件=====
                <header>
                    <slot name="header" :header="header"></slot>
                </header>
               <main >
                    <slot name="default"></slot>
               </main>
                

                <footer>
                        <slot  name="footer"></slot>
                </footer>
                
            </div>`,

        };
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue'
            },
            components: {
                brother
            }
        });
    </script>
</body>

</html>